[id].vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. <template>
  2. <LayoutContainer>
  3. <LayoutNavigation />
  4. <v-row>
  5. <v-col cols="12">
  6. <div class="banner-container">
  7. <img src="/images/actu/pub.png" alt="line" class="cover-image" />
  8. </div>
  9. </v-col>
  10. </v-row>
  11. <div v-if="actu">
  12. <v-col>
  13. <div class="d-flex align-items-center ml-12">
  14. <div class="carousel-button">
  15. <i class="fa-solid fa-arrow-left" />
  16. </div>
  17. <nuxt-link to="/actualites" class="ml-2 back-button mt-12">
  18. Retour aux actualités
  19. </nuxt-link>
  20. </div>
  21. </v-col>
  22. <v-row>
  23. <v-col cols="6">
  24. <v-img>
  25. <img :src="getImageUrl(actu.attachment)" class="image-actu" />
  26. </v-img>
  27. </v-col>
  28. <v-col cols="6">
  29. <h4 class="title-actu">{{ actu.title }}</h4>
  30. </v-col>
  31. </v-row>
  32. <v-row>
  33. <p class="description-actu">
  34. {{ plainText }}
  35. </p>
  36. </v-row>
  37. <v-row class="d-flex justify-center align-center">
  38. <v-btn class="btn mb-12" text>
  39. <v-icon class="fas fa-info mr-2"></v-icon>En savoir plus
  40. </v-btn>
  41. </v-row>
  42. </div>
  43. <v-row class="d-flex justify-space-between">
  44. <p class="share ml-6">MOTS CLÉS</p>
  45. <div>
  46. <p class="share mr-6">PARTAGER</p>
  47. </div>
  48. </v-row>
  49. <v-row class="d-flex justify-space-between mb-8">
  50. <p class="key-word mt-3 ml-6">ROCK CONCERT FESTIVAL</p>
  51. <div class="social-icons mr-6">
  52. <a href="https://facebook.com" target="_blank" class="social-icon">
  53. <i class="fa-brands fa-facebook"></i>
  54. </a>
  55. <a href="https://twitter.com" target="_blank" class="social-icon">
  56. <i class="fa-brands fa-twitter"></i>
  57. </a>
  58. <a href="https://messenger.com" target="_blank" class="social-icon">
  59. <i class="fa-brands fa-facebook-messenger"></i>
  60. </a>
  61. <a href="https://instagram.com" target="_blank" class="social-icon">
  62. <i class="fa-brands fa-instagram"></i>
  63. </a>
  64. <a href="https://linkedin.com" target="_blank" class="social-icon">
  65. <i class="fa-brands fa-linkedin"></i>
  66. </a>
  67. <a href="mailto:example@example.com" class="social-icon">
  68. <i class="fa-solid fa-envelope"></i>
  69. </a>
  70. </div>
  71. </v-row>
  72. <v-row class="container-green">
  73. <v-col cols="12">
  74. <div class="d-flex justify-center align-center">
  75. <div class="carousel-button" @click="goPrevious">
  76. <i class="fas fa-chevron-left" />
  77. </div>
  78. <div class="carousel-button" @click="goNext">
  79. <i class="fas fa-chevron-right" />
  80. </div>
  81. </div>
  82. <Carousel ref="carousel" :items-to-show="3" :items-to-scroll="2">
  83. <Slide
  84. v-for="(event, index) in events"
  85. :key="index"
  86. class="slide-card"
  87. >
  88. <div class="card">
  89. <img class="card-img-top" :src="event.img" alt="Card image cap" />
  90. <div class="card-body">
  91. <small class="card-rdv">{{ event.rdv }}</small>
  92. <h5 class="card-title">
  93. {{ event.title }}
  94. </h5>
  95. <p class="card-localisation">
  96. {{ event.localisation }}
  97. </p>
  98. </div>
  99. <div class="card-footer">
  100. <v-chip-group active-class="primary--text" column>
  101. <v-chip
  102. v-for="(tag, indexTag) in event.tags"
  103. :key="indexTag"
  104. class="ma-2 chip-custom"
  105. :color="tagColor(tag)"
  106. label
  107. >
  108. <span :class="tagTextColor(tag)">{{ tag }}</span>
  109. </v-chip>
  110. </v-chip-group>
  111. </div>
  112. </div>
  113. </Slide>
  114. </Carousel>
  115. </v-col>
  116. </v-row>
  117. </LayoutContainer>
  118. <LayoutPrefooter />
  119. <LayoutFooter />
  120. </template>
  121. <script setup lang="ts">
  122. import { ref } from "vue";
  123. import { Carousel, Slide } from "vue3-carousel";
  124. import { useRoute } from "vue-router";
  125. import "vue3-carousel/dist/carousel.css";
  126. import { useMaestroRequestService } from "~/composables/useMaestroRequestService";
  127. const { apiRequestService } = useMaestroRequestService();
  128. const actu = ref(null);
  129. const route = useRoute();
  130. const newsId = route.params.id;
  131. const pending = ref(true);
  132. // data event list using lazy loading
  133. onMounted(async () => {
  134. try {
  135. actu.value = await apiRequestService.get(
  136. `https://local.maestro.opentalent.fr/api/news/${newsId}`
  137. );
  138. pending.value = false;
  139. } catch (error) {
  140. console.error("Erreur lors de la récupération de l'actualité", error);
  141. pending.value = false;
  142. }
  143. });
  144. const getImageUrl = (attachment: string) => {
  145. if (attachment) {
  146. return `https://local.maestro.opentalent.fr/uploads/news/${attachment}`;
  147. }
  148. console.log("pas d'image");
  149. return "/images/actu/image.png";
  150. };
  151. const plainText = computed(() => {
  152. let doc = new DOMParser().parseFromString(actu.value?.bodyText, 'text/html');
  153. return doc.body.textContent || "";
  154. });
  155. const tagColor = (tag) => {
  156. switch (tag) {
  157. case "Payant":
  158. return "red";
  159. case "Gratuit":
  160. return "green";
  161. default:
  162. return "primary";
  163. }
  164. };
  165. const tagTextColor = (tag) => {
  166. switch (tag) {
  167. case "Payant":
  168. return "red--text";
  169. case "Gratuit":
  170. return "green--text";
  171. default:
  172. return "white--text";
  173. }
  174. };
  175. const events = ref([
  176. {
  177. rdv: "20h00",
  178. title: "LA NUIT DES RÊVES ",
  179. localisation: "FESTIVALDE musique - LONGCHAMP",
  180. date: "21/06/2023",
  181. img: "/images/agenda/agenda2.jpg",
  182. tags: ["Festival", "Musique", "Tout public", "Payant"],
  183. },
  184. {
  185. rdv: "20h00",
  186. title: "LE LAC DES CYGNES",
  187. localisation: "SPECTACLE DE DANSE - PARIS 1",
  188. date: "22/06/2023",
  189. img: "/images/agenda/agenda3.jpg",
  190. tags: ["Festival", "Musique", "Tout public", "Gratuit"],
  191. },
  192. {
  193. rdv: "20h00",
  194. title: "SOLIDAYS 2023 : 23 > 25 juin",
  195. localisation: "ORCHESTRE DE PARIS - PARIS 12",
  196. date: "23/06/2023",
  197. img: "/images/agenda/agenda4.jpg",
  198. tags: ["Festival", "Musique", "Tout public", "Payant"],
  199. },
  200. {
  201. rdv: "20h00",
  202. title: "LE LAC DES CYGNES",
  203. localisation: "FESTIVALDE musique - LONGCHAMP",
  204. date: "24/06/2023",
  205. img: "/images/agenda/agenda5.jpg",
  206. tags: ["Festival", "Musique", "Tout public", "Payant"],
  207. },
  208. {
  209. rdv: "20h00",
  210. title: "SOLIDAYS 2023 : 23 > 25 juin ",
  211. localisation: "SPECTACLE DE DANSE - PARIS 1",
  212. date: "20/06/2023",
  213. img: "/images/agenda/agenda1.jpg",
  214. tags: ["Festival", "Musique", "Tout public", "Payant"],
  215. },
  216. ]);
  217. let carousel;
  218. const goPrevious = () => carousel.prev();
  219. const goNext = () => carousel.next();
  220. </script>
  221. <style scoped>
  222. .banner-container {
  223. position: relative;
  224. overflow: hidden;
  225. display: flex;
  226. justify-content: center;
  227. align-items: flex-start;
  228. height: 25rem;
  229. width: 100%;
  230. }
  231. .cover-image {
  232. width: 95%;
  233. height: auto;
  234. object-fit: cover;
  235. margin: 0 auto;
  236. display: block;
  237. }
  238. .btn {
  239. background: var(--Vert-60, #64afb7);
  240. display: flex;
  241. left: 0;
  242. padding: 25px 28px;
  243. align-items: center;
  244. gap: 9px;
  245. color: var(--NEUTRAL---BLANC, #fff);
  246. font-family: Barlow;
  247. font-size: 0.9rem;
  248. border-radius: 5px;
  249. font-style: normal;
  250. font-weight: 700;
  251. line-height: 15px;
  252. letter-spacing: 1.3px;
  253. text-transform: uppercase;
  254. margin-bottom: -1rem;
  255. }
  256. .green--text {
  257. color: green;
  258. }
  259. .red--text {
  260. color: red;
  261. }
  262. .black--text {
  263. color: black;
  264. }
  265. .btn-news {
  266. color: #9edbdd;
  267. border-radius: 2rem;
  268. font-family: "Barlow";
  269. background: transparent;
  270. border: 1px solid #9edbdd;
  271. border-radius: 6px;
  272. font-style: normal;
  273. font-weight: 600;
  274. text-transform: uppercase;
  275. display: flex;
  276. flex-direction: row;
  277. align-items: center;
  278. padding: 25px;
  279. font-size: 10px;
  280. line-height: 15px;
  281. }
  282. .chip-detail {
  283. color: #000000;
  284. }
  285. .chip-custom {
  286. color: white;
  287. border: 1px solid white;
  288. border-radius: 3rem;
  289. text-transform: uppercase;
  290. font-family: "Barlow";
  291. font-style: normal;
  292. display: flex;
  293. align-items: center;
  294. text-align: center;
  295. }
  296. .card-localisation {
  297. letter-spacing: 0.18em;
  298. text-transform: uppercase;
  299. font-size: 10px;
  300. color: #112528;
  301. }
  302. .card {
  303. border-radius: 15px 15px 0 0;
  304. margin-bottom: 2rem;
  305. }
  306. .icon-title {
  307. color: #64afb7;
  308. margin-top: 4.5rem;
  309. }
  310. .container-title {
  311. display: flex;
  312. align-items: center;
  313. margin-left: 2rem;
  314. margin-top: 4.5rem;
  315. }
  316. .carousel-button i {
  317. color: #000000;
  318. }
  319. .card-text {
  320. font-family: "Barlow";
  321. font-style: normal;
  322. font-weight: 500;
  323. font-size: 16px;
  324. line-height: 18px;
  325. margin-bottom: 1rem;
  326. color: #fff !important;
  327. }
  328. .card-title {
  329. font-family: "Barlow";
  330. font-style: normal;
  331. font-weight: 500;
  332. font-size: 20px;
  333. line-height: 24px;
  334. display: flex;
  335. align-items: center;
  336. letter-spacing: 0.18em;
  337. text-transform: uppercase;
  338. color: #fff !important;
  339. }
  340. .card-date {
  341. font-size: 0.8em;
  342. color: #888;
  343. margin-left: 1rem;
  344. color: #fff !important;
  345. }
  346. .card-footer {
  347. display: flex;
  348. justify-content: space-between;
  349. align-items: center;
  350. }
  351. .card-body {
  352. text-align: left;
  353. margin-bottom: 1rem;
  354. margin-left: 1rem;
  355. font-family: "Barlow";
  356. font-style: normal;
  357. font-weight: 500;
  358. line-height: 24px;
  359. color: #fff !important;
  360. color: #112528;
  361. }
  362. .card-img-top {
  363. border-radius: 9px 9px 0 0;
  364. width: 100%;
  365. object-fit: 90%;
  366. object-position: center;
  367. width: 384px;
  368. height: 247.11px;
  369. }
  370. .title,
  371. .carousel-button,
  372. .btn-news {
  373. margin-top: 2rem;
  374. margin-bottom: 2rem;
  375. }
  376. .agenda-details {
  377. font-family: "Barlow";
  378. font-style: normal;
  379. font-weight: 300;
  380. font-size: 16px;
  381. line-height: 20px;
  382. margin-left: 2rem;
  383. color: #091d20;
  384. margin-bottom: 3rem;
  385. width: 15rem;
  386. }
  387. .title {
  388. font-family: "Barlow";
  389. font-style: normal;
  390. font-weight: 600;
  391. font-size: 42px;
  392. line-height: 42px;
  393. margin-left: 2rem;
  394. color: #071b1f;
  395. }
  396. .carousel-button {
  397. display: flex;
  398. justify-content: center;
  399. align-items: center;
  400. width: 60px;
  401. height: 60px;
  402. background-color: transparent;
  403. border: 2px solid #000000;
  404. cursor: pointer;
  405. margin-right: 1rem;
  406. }
  407. .container-green {
  408. background-color: #0e2d32;
  409. }
  410. .back-button {
  411. text-decoration: none;
  412. color: #000000;
  413. font-family: Barlow;
  414. font-size: 0.9rem;
  415. font-style: normal;
  416. font-weight: 700;
  417. line-height: 15px;
  418. letter-spacing: 1.8px;
  419. text-transform: uppercase;
  420. }
  421. .image-actu {
  422. width: 80%;
  423. margin-left: 3.5rem;
  424. margin-right: auto;
  425. }
  426. .title-actu {
  427. margin-top: 11rem;
  428. text-decoration: none;
  429. text-transform: uppercase;
  430. font-family: Barlow;
  431. font-size: 36px;
  432. font-style: normal;
  433. font-weight: 600;
  434. }
  435. .description-actu {
  436. color: #0e2d32;
  437. text-align: justify;
  438. font-family: Barlow;
  439. font-size: 30px;
  440. font-style: normal;
  441. font-weight: 500;
  442. line-height: 34px;
  443. margin-left: 3.5rem;
  444. margin-right: 3.5rem;
  445. margin-bottom: 3rem;
  446. }
  447. .share {
  448. color: #000;
  449. font-family: Barlow;
  450. font-size: 26px;
  451. font-style: normal;
  452. font-weight: 400;
  453. line-height: 28px;
  454. }
  455. .social-icons {
  456. display: flex;
  457. gap: 10px;
  458. }
  459. .social-icon i {
  460. font-size: 1.9em;
  461. margin-left: .5rem;
  462. margin-top: .5rem
  463. }
  464. .key-word{
  465. color: #000;
  466. font-family: Barlow;
  467. font-size: 20px;
  468. font-style: normal;
  469. font-weight: 500;
  470. line-height: 24px;
  471. }
  472. .title-other{
  473. color: #fff;
  474. }
  475. </style>